<template>
  <view
    class="content"
    :style="{
      'padding-top': height + 'px',
      'box-sizing': 'border-box',
    }"
  >
    <view
      :style="{
        width: '100%',
        height: statusBarHeight + 'px',
        background: 'white',
        position: 'fixed',
        top: 0,
        zIndex: 100,
      }"
    >
    </view>
    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#444444"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text">{{this.title}}</view>
      <view class="head_right"> </view>
    </view>

    <view class="box" v-html="detail.content"  :style="{ marginTop: statusBarHeight + 'px' }">
       
    </view>
    
    <floatingBall></floatingBall>
  </view>
</template>
  
  <script>
import selectType from "@/components/selectType.vue";
export default {
  components: {
    selectType,
  },
  data() {
    return {
      statusBarHeight: 0,
      height: 0,
      detail:{},
      title:'',
      id:''
    };
  },
  onLoad(options) {
    this.title = options.title
    this.id = options.id
    
  },
  created() {
    this.getDetail()
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度

    this.statusBarHeight = statusBarHeight.statusBarHeight;
    this.$nextTick(() => {
      uni
        .createSelectorQuery()
        .select(".head")
        .boundingClientRect((data) => {
          this.height = data.height + 29;
        })
        .exec();
    });
  },
  methods: {
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    getDetail(){
      this.$http
        .helpfulidetail({id:this.id})
        .then((res) => {
          // console.log(res.data.info, "福利详情");
          // this.list = res.data.list.data;
          this.detail = res.data.info
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    }
  },
};
</script>
  
  <style scoped lang="scss">
.content {
  box-sizing: border-box;
}
.head {
  width: 100%;
  padding: 18rpx 30rpx 47rpx;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 99;
  background: #fff;

  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .head_right {
    position: absolute;
    right: 30rpx;
    display: flex;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #444444;
  }
}
.box {
  padding: 0 30rpx;
  .box_img{
    width: 100%;
  }
  .box_view{
    padding: 56rpx 30rpx;
    box-sizing: border-box;
    .box_view_title{
        font-size: 32rpx;
        color: #444444;
    }
    .box_view_text{
        font-size: 28rpx;
        color: #444444;
        line-height: 46rpx;
        margin-top: 24rpx;
    }
  }
  
}
</style>